<%= error_messages_for :ticket %>
<% form_for :ticket, :url => tickets_path, :html => {:method => :post, :onSubmit => "set_checkboxes();"} do -%>
<table border = "0" width = "100%"><tr><td>
Type: <%=h @ticket_template.name %><br />
<label for="ticket_name">Name:</label>
<%= text_field 'ticket', 'name'  %><br />

<label for="ticket_deadline">Deadline:</label>
<%= calendar_date_select_tag "ticket[deadline]", @ticket.deadline, :id => "ticket_deadline" %><br />
<label for="ticket_group">Group:</label>
	<%= select("ticket", "group_id", @groups.collect{ |g| [g.name, g.id]}, 
	:selected => ((current_user.groups && (current_user.groups != []))? current_user.groups[0].id : @groups[0].id)) %><br />
</td> <td align = 'right'> <%= submit_tag 'Create' %></td></tr></table>
<%= render :partial => 'fields'-%>
<%= hidden_field_tag("ticket[ticket_template_id]", "#{@ticket_template.id}") %>

<% end %>
